﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ZhimeiSoft.CharmManager.DOL
{
    /// <summary>
    /// 会员信息表
    /// </summary>
    [Serializable()]    
    public class DBEntityCustomInfo : DBEntityBase
    {
        public DBEntityCustomInfo(DataRow customInfo)
            : base()
        {
            this.CUSTOMERID = Convert.ToInt32(customInfo[DBEntityCustomInfo.FieldName.CUSTOMERID]);
            this.CNAME = customInfo[DBEntityCustomInfo.FieldName.CNAME].ToString();
            this.CNICKNAME = customInfo[DBEntityCustomInfo.FieldName.CNICKNAME].ToString();
            this.CBIRTHDAY = Convert.ToDateTime(customInfo[DBEntityCustomInfo.FieldName.CBIRTHDAY]);
            this.CBIRTHDAYTYPE = customInfo[DBEntityCustomInfo.FieldName.CBIRTHDAYTYPE].ToString();
            this.CHEIGHT = customInfo[DBEntityCustomInfo.FieldName.CHEIGHT].ToString();
            this.CWIGHT = customInfo[DBEntityCustomInfo.FieldName.CWIGHT].ToString();
            this.CMOBILEPHONE = customInfo[DBEntityCustomInfo.FieldName.CMOBILEPHONE].ToString();
            this.CFAMLIYPHONE = customInfo[DBEntityCustomInfo.FieldName.CFAMLIYPHONE].ToString();
            this.CZIPCODE = customInfo[DBEntityCustomInfo.FieldName.CZIPCODE].ToString();
            this.CADDRESS = customInfo[DBEntityCustomInfo.FieldName.CADDRESS].ToString();
            this.CMAIL = customInfo[DBEntityCustomInfo.FieldName.CMAIL].ToString();
            this.CINDEXCODE = customInfo[DBEntityCustomInfo.FieldName.CINDEXCODE].ToString();
            this.SALONID = Convert.ToInt32( customInfo[DBEntityCustomInfo.FieldName.SALONID]);
            this.CREGISTERDATE = Convert.ToDateTime( customInfo[DBEntityCustomInfo.FieldName.CREGISTERDATE]);
            this.CANCELDATE = Convert.ToDateTime( customInfo[DBEntityCustomInfo.FieldName.CANCELDATE]);
            this.CSTATE = customInfo[DBEntityCustomInfo.FieldName.CSTATE].ToString();
            this.CLASTREGISTERDATE = Convert.ToDateTime( customInfo[DBEntityCustomInfo.FieldName.CLASTREGISTERDATE]);
            this.CLASTCALL = Convert.ToDateTime( customInfo[DBEntityCustomInfo.FieldName.CLASTCALL]);
            this.CMEMO = customInfo[DBEntityCustomInfo.FieldName.CMEMO].ToString();
            this.CONSTELLATORY = customInfo[DBEntityCustomInfo.FieldName.CONSTELLATORY].ToString();
            if (customInfo[DBEntityCustomInfo.FieldName.BLODDTYPE] == System.DBNull.Value)
            {
                this.BLODDTYPE = string.Empty;
            }
            else
            {
                this.BLODDTYPE = customInfo[DBEntityCustomInfo.FieldName.BLODDTYPE].ToString();
            }

        }

        public DBEntityCustomInfo()
            : base()
        {
        }
        /// <summary>
        /// 表名称
        /// </summary>
        /// <returns>返回表名称</returns>
        public override string GetTableName()
        {
            return "CUSTOMINFO";
        }
        /// <summary>
        /// 会员信息ID
        /// </summary>
        public int CUSTOMERID { get; set; }
        /// <summary>
        /// 会员名称
        /// </summary>
        public string CNAME { get; set; }
        /// <summary>
        /// 会员昵称
        /// </summary>
        public string CNICKNAME { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime CBIRTHDAY { get; set; }
        /// <summary>
        /// 生日类型 CY 阳历、 CN 阴历
        /// </summary>
        public string CBIRTHDAYTYPE { get; set; }
        /// <summary>
        /// 身高
        /// </summary>
        public string CHEIGHT { get; set; }
        /// <summary>
        /// 体重
        /// </summary>
        public string CWIGHT { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string CMOBILEPHONE { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string CFAMLIYPHONE { get; set; }
        /// <summary>
        /// 邮政编码
        /// </summary>
        public string CZIPCODE { get; set; }
        /// <summary>
        /// 邮寄地址
        /// </summary>
        public string CADDRESS { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        public string CMAIL { get; set; }
        /// <summary>
        /// 快速定位码
        /// </summary>
        public string CINDEXCODE { get; set; }
        /// <summary>
        /// 会员所属店
        /// </summary>
        public int SALONID { get; set; }
        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime CREGISTERDATE { get; set; }
        /// <summary>
        /// 注销时间
        /// </summary>
        public DateTime CANCELDATE { get; set; }
        /// <summary>
        /// C0A 有效会员 C0I 注销会员 C0L 长时间不到店
        /// </summary>
        public String CSTATE { get; set; }
        /// <summary>
        /// 最后一次到店时间
        /// </summary>
        public DateTime CLASTREGISTERDATE { get; set; }
        /// <summary>
        /// 最后一次回访时间
        /// </summary>
        public DateTime CLASTCALL { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        public string CMEMO { get; set; }
        /// <summary>
        /// 星座
        /// </summary>
        public string CONSTELLATORY { get; set; }
        /// <summary>
        /// 血型
        /// </summary>
        public string BLODDTYPE { get; set; }

        /// <summary>
        /// 字段名
        /// </summary>
        public static class FieldName
        {
            /// <summary>
            /// 会员信息ID
            /// </summary>
            public const string CUSTOMERID = "CUSTOMERID";
            /// <summary>
            /// 会员名称
            /// </summary>
            public const string CNAME = "CNAME";
            /// <summary>
            /// 会员昵称
            /// </summary>
            public const string CNICKNAME = "CNICKNAME";
            /// <summary>
            /// 生日
            /// </summary>
            public const string CBIRTHDAY = "CBIRTHDAY";
            /// <summary>
            /// 生日类型 阳历生日 CY 阴历生日 CN
            /// </summary>
            public const string CBIRTHDAYTYPE = "CBIRTHDAYTYPE";
            /// <summary>
            /// 身高
            /// </summary>
            public const string CHEIGHT = "CHEIGHT";
            /// <summary>
            /// 体重
            /// </summary>
            public const string CWIGHT = "CWIGHT";
            /// <summary>
            /// 联系电话
            /// </summary>
            public const string CMOBILEPHONE = "CMOBILEPHONE";
            /// <summary>
            /// 联系电话
            /// </summary>
            public const string CFAMLIYPHONE = "CFAMLIYPHONE";
            /// <summary>
            /// 邮政编码
            /// </summary>
            public const string CZIPCODE = "CZIPCODE";
            /// <summary>
            /// 邮寄地址
            /// </summary>
            public const string CADDRESS = "CADDRESS";
            /// <summary>
            /// 电子邮件
            /// </summary>
            public const string CMAIL = "CMAIL";
            /// <summary>
            /// 快速定位码
            /// </summary>
            public const string CINDEXCODE = "CINDEXCODE";
            /// <summary>
            /// 会员所属店
            /// </summary>
            public const string SALONID = "SALONID";
            /// <summary>
            /// 注册时间
            /// </summary>
            public const string CREGISTERDATE = "CREGISTERDATE";
            /// <summary>
            /// 注销时间
            /// </summary>
            public const string CANCELDATE = "CANCELDATE";
            /// <summary>
            /// C0A 有效会员 C0I 注销会员 C0L 长时间不到店
            /// </summary>
            public const string CSTATE = "CSTATE";
            /// <summary>
            /// 最后一次到店时间
            /// </summary>
            public const string CLASTREGISTERDATE = "CLASTREGISTERDATE";
            /// <summary>
            /// 最后一次回访时间
            /// </summary>
            public const string CLASTCALL = "CLASTCALL";
            /// <summary>
            /// 备注信息
            /// </summary>
            public const string CMEMO = "CMEMO";
            /// <summary>
            /// 星座
            /// </summary>
            public const string CONSTELLATORY = "CONSTELLATORY";
            /// <summary>
            /// 血型
            /// </summary>
            public const string BLODDTYPE = "BLODDTYPE";
        }
        /// <summary>
        ///  C0A 有效会员 C0I 注销会员 C0N 新会员
        /// </summary>
        public static class ENUM_CSTATE
        {
            
            /// <summary>
            ///  C0A 有效会员
            /// </summary>
            public const string C0A = "C0A";
            /// <summary>
            ///  C0I 注销会员
            /// </summary>
            public const string C0I = "C0I";
            /// <summary>
            ///  C0N 新会员
            /// </summary>
            public const string C0N = "C0N";
            /// <summary>
            ///  C0A 有效会员
            /// </summary>
            public const string C0A_CHINESE = "有效会员";
            /// <summary>
            ///  C0I 注销会员
            /// </summary>
            public const string C0I_CHINESE = "注销会员";
            /// <summary>
            ///  C0L 长时间不到店
            /// </summary>
            public const string C0N_CHINESE = "新会员";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[]{C0A, C0I, C0N};
                string[] sReturnStr = new string[] { C0A_CHINESE, C0I_CHINESE, C0N_CHINESE };
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { C0A_CHINESE, C0I_CHINESE, C0N_CHINESE };
                string[] sReturnStr = new string[] { C0A, C0I, C0N };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }
        }
        /// <summary>
        /// 生日类型 阳历生日 CY 阴历生日 CN
        /// </summary>
        public static class ENUM_CBIRTHDAYTYPE
        {
            /// <summary>
            /// 阳历生日
            /// </summary>
            public const string CY = "CY";
            /// <summary>
            /// 阴历生日
            /// </summary>
            public const string CN = "CN";
            /// <summary>
            /// 阳历生日
            /// </summary>
            public const string CY_CHINESE = "阳历生日";
            /// <summary>
            /// 阴历生日
            /// </summary>
            public const string CN_CHINESE = "阴历生日";

            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { CY, CN };
                string[] sReturnStr = new string[] { CY_CHINESE, CN_CHINESE };
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { CY_CHINESE, CN_CHINESE };
                string[] sReturnStr = new string[] { CY, CN };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }
            
        }
        
    }
}
